﻿using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Text;
using LView.CMS.IServices;
using Microsoft.AspNetCore.Http;

namespace LView.CMS.Services
{
    public class PrincipalAccessorService : IPrincipalAccessorService
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public PrincipalAccessorService(IHttpContextAccessor httpContextAccessor)
        {
            _httpContextAccessor = httpContextAccessor;
        }

        public ClaimsPrincipal Principal => _httpContextAccessor.HttpContext?.User;
    }
}
